/*
 * @Author: your name
 * @Date: 2022-04-02 15:48:55
 * @LastEditTime: 2022-04-15 13:55:37
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \dataonline-vite-ts\src\router\asyncRouters.ts
 */
import {RouteRecordRaw} from 'vue-router'
import config from '@/config'
import deepClone from '@/libs/deepClone'
// import {treeMap} from '@/libs/toolkit'
// import {layoutComp, moduleComp} from '@/libs/defineComponent'

function handleAsideConfig(): RouteRecordRaw[] {
  const aside_config = deepClone(config.router)
  // treeMap(aside_config, 'children', (data: any) => {
  //   try {
  //     if (data.layout) {
  //       data.component = layoutComp()
  //     } else {
  //       data.component = moduleComp(data.component)
  //     }
  //   } catch (e) {
  //     console.log(e)
  //   }
  // })
  return aside_config
}

const asyncRouters = handleAsideConfig()

export default asyncRouters
